package current;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class ShortTest {

	public static void main(String[] args) {
		
		Map<String, String> map = getMap();
		System.out.println(map);
		
		String nullable = map.get("unknown");
		System.out.println(nullable);
		
		for (Iterator<Map.Entry<String,String>> iterator = map.entrySet().iterator(); iterator.hasNext();)
		{
			 Map.Entry<String,String> entry = iterator.next();  
			
	        if (entry.getValue() == null || entry.getValue().length() == 0){
	        	 iterator.remove();
	        }
	    }
		
		
		System.out.println(map);
	}
	
	public static Map<String, String> getMap()
	{
		
		Map<String, String> map = new HashMap<String, String>();
		
		map.put("apply", "hotel");
		map.put("retrieve", "hotel, air");
		map.put("cancel", "");
		map.put("getcanceldetails", null);
		
		return map;
	}
	
}
